<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<script type="text/javascript">
$(function(){
	$("#back").click(function(){
		one.changeContent(one.urls[one.urls.length -2]);
	});
	$("#content").css("background","url("+BASEURL+"files/cp/icons/form.gif) no-repeat right bottom");
});
</script>
<form method="post" action="<?php echo base_url()?>cp/contacts/submitForm/<?php echo $modelName."/"; echo (isset($item) && isset($item->id))?"edit/$item->id":"add"; ?>" enctype="multipart/form-data">
	<input type="hidden" name="backAfterSubmit" id="backAfterSubmit" value="<?php echo "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; ?>" />
	<table width="100%" cellpadding="3" cellspacing="1">
		<tr>
			<td width="120">Date & Time :</td>
			<td><?php echo $item->insert_time; ?></td>
		</tr>
		<tr>
			<td>Name :</td>
			<td><?php echo $item->fullname; ?></td>
		</tr>
		<tr>
			<td>Email :</td>
			<td><a href="mailto:<?php echo $item->email; ?>"><?php echo $item->email; ?></a></td>
		</tr>
		<tr>
			<td>IP :</td>
			<td><a href="http://www.google.com/search?q=whois+<?php echo $item->ip; ?>" target="_blank"><?php echo $item->ip; ?></a></td>
		</tr>
		<tr>
			<td>Subject :</td>
			<td><?php echo $item->subject; ?></td>
		</tr>
		<tr>
			<td valign="top">Message :</td>
			<td><?php echo $item->message; ?></td>
		</tr>
		<tr><td colspan="2"><hr noshade="noshade" /></td></tr>
		<?php if(isset($replies) && count($replies) > 0): ?>
			<?php foreach($replies as $reply): ?>
				<tr>
					<td>Date & Time :</td>
					<td><?php echo $reply->insert_time; ?></td>
				</tr>
				<tr>
					<td>Name :</td>
					<td><?php echo $reply->fullname; ?></td>
				</tr>
				<tr>
					<td>IP :</td>
					<td><a href="http://www.google.com/search?q=whois+<?php echo $reply->ip; ?>" target="_blank"><?php echo $reply->ip; ?></a></td>
				</tr>
				<tr>
					<td valign="top">Message :</td>
					<td><?php echo $reply->message; ?></td>
				</tr>
				<tr><td colspan="2"><br /><hr noshade="noshade" /></td></tr>
			<?php endforeach; ?>
		<?php endif; ?>
		<tr>
			<td valign="top"><h1 style="color:#ccc;font-size: 1.5em">Make a reply :</h1></td>
			<td><textarea cols="92" rows="10" name="message" id="message"></textarea></td>
		</tr>
		<tr>
			<td colspan="2" style="text-align: center;">
				<input onclick="return FormValidator.validate('form1');" type="submit" name="submit" value="Send" />&nbsp;&nbsp;<input value="Back" type="button" id="back" name="back" />
			</td>
		</tr>
	</table>
</form>
<script type="text/javascript">
	FormValidator.clear();
	FormValidator.setElement("form1","message","Message","xinha",true);
</script>